//
//  NSObject+RBAdd.h
//  Tourist
//
//  Created by Lan on 2017/7/26.
//  Copyright © 2017年 SummerTea. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "RBPhotoBrowser.h"
#import <TZImagePickerController.h>
#import "RBRequestHM.h"

@interface UIViewController(RBAdd)<UINavigationControllerDelegate, UIImagePickerControllerDelegate, UIActionSheetDelegate>

//单张照片选取,iOS11比较卡
- (void)chooseSingleImageAllowsEditing:(BOOL)allowsEditing
                            completion: (void(^)(UIImage *image))completion;
- (void)chooseSingleImageAllowsEditing:(BOOL)allowsEditing
                                 title: (NSString *)title
                            completion:(void (^)(UIImage *image))completion;

- (void)presentVc: (UIViewController *)vc;

@end

@interface UIViewController(RBImageMultiplePick)<TZImagePickerControllerDelegate>

- (void)chooseImagesWithCount: (NSInteger)count
                   completion:(void (^)(NSArray *images))completion;;

@end

@interface UIViewController(RBPhoto)<RBPhotoDelegate>

- (void)showWithImages: (NSArray *)images
                 index: (NSInteger)index
            imageViews: (NSArray *)imageViews;

@end

@interface UIViewController(RBCommonSet)

@property(nonatomic, assign) UIStatusBarStyle statusBarStyle;
@property(nonatomic, assign) BOOL ignoreStatusAjust;
@property(nonatomic, strong)RBRequestHM *defaultHm;

@end

@interface UIViewController(RBLoadData)

/**
 不需要控制hud
 sucBlock 刷新ui
 failBlock 可以toast
 reloadBlock 调用刷新方法
 */
- (void)viewLoadDataWithParam: (void(^)(NSMutableDictionary *dicM))paramSetupBlock
                         path: (NSString *)path
                         post: (BOOL)post
                          log: (BOOL)log
                responseClass: (Class)responseClass
                      desView: (UIView *)desView
                      showHud: (BOOL)showHud
              showPlaceHolder: (BOOL)showPlaceHolder
                     sucBlock: (void(^)(id data))sucBlock
                    failBlock: (void(^)(id data))failBlock
                  reloadBlock: (void(^)(void))reloadBlock;

//以下方法都需要实现
- (NSString *)listPageKey;//page名
- (NSDictionary *)listParams;//出去page所有参数
- (NSString *)listRequestPath;//请求路径
- (NSInteger)ListCurrentPage;//直接返,self.response.currentPage
- (BOOL)listLog;
- (BOOL)listPost;
- (Class)listResponseClass;
- (UIScrollView *)listView;

/**
 不需要控制hud
 */
- (void)listLoadFirstPageWithDesView: (UIView *)desView
                     showPlaceHolder: (BOOL)showPlaceHolder
                            sucBlock: (void(^)(id data))sucBlock
                           failBlock: (void(^)(id data))failBlock
                         reloadBlock: (void(^)(void))reloadBlock;
- (void)listLoadNextPageWithSucBlock: (void(^)(id data))sucBlock
                           failBlock: (void(^)(id data))failBlock;

@end
